package com.fzq.client;

import com.fzq.common.DescreaseStockInput;
import com.fzq.common.ProductInfoOutput;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

@FeignClient(name = "product-server")
public interface ProductFeign {

    @GetMapping("/product/list")
    Map<String, Object> getProductList();

    @PostMapping("/product/listfororder")
    List<ProductInfoOutput> listForOrder(@RequestBody List<String> ids);

    @PostMapping("/product/descreasestock")
    void decreaseStock(@RequestBody List<DescreaseStockInput> descreaseStockInputList);
}
